<%@ Page Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="Templates.aspx.cs" Inherits="Impact.Web.Admin.Templates" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <table class="AdminTable">
        <tr>
            <th>Templates:</th>
            <th class="NonHeader">Delete</th>
        </tr>


    <asp:Repeater ID="templateList" runat="server" OnItemCommand="TemplateList_ItemCommand">
        <ItemTemplate>
            <tr>
                <td style="text-align: left; padding-left: 30px;"><a href="EditTemplate.aspx?pid=<%# Eval("PageId") %>"><%# Eval("Caption") %></a></td>
                                       
                <td style="text-align: center;">
                    <asp:ImageButton ID="deleteButton" CommandName="delete" CommandArgument='<%# Eval("PageId") %>'
                        ImageUrl="images/red-x.png" runat="server" />
                </td>
            </tr>
        </ItemTemplate>
    </asp:Repeater>
    
    <asp:Panel ID="noTemplatesPanel" Visible="false" runat="server">
        <tr>
            <td colspan="2" style="text-align: center;">There have been no templates defined yet.</td>
        </tr>
    </asp:Panel>

        <tr>
            <td colspan="2" style="text-align: right;">
                <impact:ImageLinkButton ID="newTemplateButton" CssClass="AdminTableButton" runat="server"
                    ImageUrl="images/add.png" Text="Create New Template" TargetUrl="EditTemplate.aspx" />
            </td>
        </tr>

    </table>
    
    <table class="AdminTable">
    
        <tr>
            <td>Category Listing Template:</td>
            <td><asp:DropDownList ID="categoryTemplate" AppendDataBoundItems="true" AutoPostBack="true" 
                        OnSelectedIndexChanged="TemplateChanged" runat="server">
                    <asp:ListItem Value="-1">None</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>Article Listing Template:</td>
            <td><asp:DropDownList ID="articleTemplate" AppendDataBoundItems="true" AutoPostBack="true" 
                        OnSelectedIndexChanged="TemplateChanged" runat="server">
                    <asp:ListItem Value="-1">None</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td>Tag Listing Template:</td>
            <td><asp:DropDownList ID="tagTemplate" AppendDataBoundItems="true" AutoPostBack="true" 
                        OnSelectedIndexChanged="TemplateChanged" runat="server">
                    <asp:ListItem Value="-1">None</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        
    </table>

</asp:Content>
